package Java常用类的学习;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

/*
*
* */
public class ArrayListTest {
    public static void main(String args[]){
        Random random=new Random(49);
        List<String> list=new ArrayList<String>();
        list.add(new String("rat"));
        list.add(new String("monkey"));
        list.add(new String("pig"));
        list.add(new String("rabbit"));
        System.out.println("1:"+list);
       System.out.println(list.contains("rat"));
       System.out.println(list.indexOf(1));
       System.out.println(list.get(1));
       List<String>  sub=list.subList(1,3);
       System.out.println(sub);
       System.out.println(list.containsAll(sub));

    }
}
